package com.dt76.smallloanbackenduser.remote.etao;

import com.dt76.smallloanbackenduser.hystrix.etao.DeptHystrix;
import com.dt76.smallloanbackenduser.pojo.etao.CurrentUser;
import com.dt76.smallloanbackenduser.pojo.etao.Department;
import com.dt76.smallloanbackenduser.pojo.etao.Employee;
import com.dt76.smallloanbackenduser.utils.Page;
import com.dt76.smallloanbackenduser.utils.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.swing.*;
import java.util.List;

@FeignClient(name = "smallloan-backend-service",fallback = DeptHystrix.class)
public interface PrivilegeManagement {

    @RequestMapping("/deptSelectAll")
    Page getAllDept(@RequestParam("pageNum") Integer pageNum);

    @RequestMapping("/getDept")
    List<Department> getDept();

    @RequestMapping("/delDeptById")
    Result delDeptById(@RequestParam("did") Integer did, @RequestBody CurrentUser currentUser);

    @RequestMapping("/getDeptById")
    Department getDeptById(@RequestParam("did") Integer did);

    @RequestMapping("/updDeptEnable")
    Result updDeptEnable(@RequestParam("did") Integer did,
                         @RequestParam("enable") Integer enable);

    @RequestMapping(value = "/addDept",method = RequestMethod.POST)
    Result addDept(@RequestBody Department department,@RequestParam("currentId") Integer currentId);

    @RequestMapping(value = "/updDept",method = RequestMethod.PUT)
    Result updDept(@RequestBody Department department,@RequestParam("currentId") Integer currentId);




}
